<?php

require_once 'common/common.php';
require_once 'common/conn.php';

$usercode = getParameter("usercode");

if ($usercode != "") {
    $db = new DBC();
    $sql = "SELECT DISTINCT code FROM t_achieve_info i,t_achieve_record r WHERE (i.code = r.achievecode AND usercode = '" . $usercode . "' AND r.id > 0 AND r.paid = 0)";
    $data = $db->fetchData($sql);
    $db->close();
}

echo json_encode($data);
?>